/*
 * @Author: moonwater 13812995013@163.com
 * @Date: 2025-03-07 09:51:35
 * @LastEditors: moonwater 13812995013@163.com
 * @LastEditTime: 2025-03-07 10:15:13
 * @FilePath: \盐师22Git仓库\day10\Circle.java
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
package day10;

public class Circle extends Shape{
    //半径
    private int r;

    //构造器
    public Circle(){}

    public Circle(String name, int r){
        super(name);
        this.r = r;
    }
    //继承了有重新方法的父类 子类必须重写父类中所有的抽象方法
    public double getArea(){
        return Math.PI * r * r;
    }   
}
